package homework;

import java.text.NumberFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class Work {
    public static void main(String[] args) {
        date();
        camel();
        snake();
        currency();
    }

    public static void date() {
        DateTimeFormatter a = DateTimeFormatter.ofPattern("yyy年M日d月");
        System.out.println(a.format(LocalDate.now()));
    }

    public static void camel() {
        String a = "MyName";
        a = a.replaceAll("[A-Z]", "_$0");
        a = a.toLowerCase();
        if (a.charAt(0) == '_') {
            a = a.substring(1);
        }
        System.out.println(a);
    }

    public static void snake() {
        String b = "my_name";
        b = b.replaceAll("_([A-Z])", "$1");
        int c = -32;
        for (char i = 'a'; i <= 'z'; ++i) {
            b = b.replaceAll("_" + i, String.valueOf((char) (c + i)));
        }
        System.out.println(b);
    }

    public static void currency() {
        double b=1234567.03;
        NumberFormat a = NumberFormat.getNumberInstance();
        System.out.println(a.format(b));
    }
}
